#include <stdio.h>

int main(int argc, char *argv[])
{

    int n = 0, sum = 0, a = 0;
    while (scanf("%d", &n)!=EOF)
    {
        if(n==0)
            break;
        for (size_t i = 0; i < n; i++)
        {
            scanf("%d", &a);
            sum += a;
        }
        printf("%d\n", sum);
        sum = 0;
    }
    
    return 0;
}